<!DOCTYPE html>
<html lang="en" class="no-js">

<head>

    <meta charset="utf-8">
    <title>Fullscreen Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- CSS -->
    <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=PT+Sans:400,700'>
    <link rel="stylesheet" href="/assets/css/reset.css">
    <link rel="stylesheet" href="/assets/css/supersized.css">
    <link rel="stylesheet" href="/assets/css/style.css">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

</head>

<body>

<div class="page-container">
    <h1>请假系统</h1>
    <form action="" id="form1" onsubmit="return false;">
        <input type="text" name="username" id="username" class="username" placeholder="Username">
        <input type="password" name="password" id="password" class="password" placeholder="Password">
        <button id="but">Sign me in</button>
        <div class="error"><span>+</span></div>
    </form>

</div>

<!-- Javascript -->
<script src="/assets/js/jquery-1.8.2.min.js"></script>
<script src="/assets/js/supersized.3.2.7.min.js"></script>
<script src="/assets/js/supersized-init.js"></script>
<script src="/assets/js/scripts.js"></script>

</body>
<script>
    $("#but").click(function () {
        var username=$("#username").val();
        var password=$("#password").val();
        if(username==''){
            $("#username").focus();
            return;
        }
        if(password==''){
            $("#password").focus();
            return;
        }
        $.ajax({
            url:"/login/login",
            type:"post",
            data:$("#form1").serialize(),
            success:function (result) {
                if(result.code==100){//如果登录成功
                    //alert(result.code);
                    location.href="/login/checkJump";
                }
                if(result.code==200){//登录失败
                    alert(result.extend.msg);
                }


            }

        })
        //alert(username+password);
    });
</script>
</html>

